package lambda;

import java.util.Arrays;
import java.util.Comparator;

public class demo {
	public static void main(String[] args) {
		String[] a=new String[]{"11","111","1"};
//		Arrays.sort(a,new LengthComparator());
		Arrays.sort(a,(String first,String second)->Integer.compare(first.length(), second.length()));
		for(String b:a){
			System.out.println(b);
		}
	}
}
class LengthComparator implements Comparator<String>{
	public int compare(String first, String second) {
		return Integer.compare(first.length(), second.length());
	}
}

